package com.xiaoyi.intentsdklibrary.Bean;

import java.util.Map;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

public class DaoSession extends AbstractDaoSession {
    private final AppBeanDao appBeanDao;
    private final DaoConfig appBeanDaoConfig;
    private final IntentBeanDao intentBeanDao;
    private final DaoConfig intentBeanDaoConfig;
    private final MsgBeanDao msgBeanDao;
    private final DaoConfig msgBeanDaoConfig;
    private final PhoneBeanDao phoneBeanDao;
    private final DaoConfig phoneBeanDaoConfig;
    private final ShareBeanDao shareBeanDao;
    private final DaoConfig shareBeanDaoConfig;

    public DaoSession(Database database, IdentityScopeType identityScopeType, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig> map) {
        super(database);
        DaoConfig clone = map.get(AppBeanDao.class).clone();
        this.appBeanDaoConfig = clone;
        clone.initIdentityScope(identityScopeType);
        DaoConfig clone2 = map.get(IntentBeanDao.class).clone();
        this.intentBeanDaoConfig = clone2;
        clone2.initIdentityScope(identityScopeType);
        DaoConfig clone3 = map.get(MsgBeanDao.class).clone();
        this.msgBeanDaoConfig = clone3;
        clone3.initIdentityScope(identityScopeType);
        DaoConfig clone4 = map.get(PhoneBeanDao.class).clone();
        this.phoneBeanDaoConfig = clone4;
        clone4.initIdentityScope(identityScopeType);
        DaoConfig clone5 = map.get(ShareBeanDao.class).clone();
        this.shareBeanDaoConfig = clone5;
        clone5.initIdentityScope(identityScopeType);
        AppBeanDao appBeanDao2 = new AppBeanDao(clone, this);
        this.appBeanDao = appBeanDao2;
        IntentBeanDao intentBeanDao2 = new IntentBeanDao(clone2, this);
        this.intentBeanDao = intentBeanDao2;
        MsgBeanDao msgBeanDao2 = new MsgBeanDao(clone3, this);
        this.msgBeanDao = msgBeanDao2;
        PhoneBeanDao phoneBeanDao2 = new PhoneBeanDao(clone4, this);
        this.phoneBeanDao = phoneBeanDao2;
        ShareBeanDao shareBeanDao2 = new ShareBeanDao(clone5, this);
        this.shareBeanDao = shareBeanDao2;
        registerDao(AppBean.class, appBeanDao2);
        registerDao(IntentBean.class, intentBeanDao2);
        registerDao(MsgBean.class, msgBeanDao2);
        registerDao(PhoneBean.class, phoneBeanDao2);
        registerDao(ShareBean.class, shareBeanDao2);
    }

    public void clear() {
        this.appBeanDaoConfig.clearIdentityScope();
        this.intentBeanDaoConfig.clearIdentityScope();
        this.msgBeanDaoConfig.clearIdentityScope();
        this.phoneBeanDaoConfig.clearIdentityScope();
        this.shareBeanDaoConfig.clearIdentityScope();
    }

    public AppBeanDao getAppBeanDao() {
        return this.appBeanDao;
    }

    public IntentBeanDao getIntentBeanDao() {
        return this.intentBeanDao;
    }

    public MsgBeanDao getMsgBeanDao() {
        return this.msgBeanDao;
    }

    public PhoneBeanDao getPhoneBeanDao() {
        return this.phoneBeanDao;
    }

    public ShareBeanDao getShareBeanDao() {
        return this.shareBeanDao;
    }
}
